C# axWindowsMediaPlayer 多个文件循环播放

您所在的位置:网站首页 windows media player怎么连续播放视频 C# axWindowsMediaPlayer 多个文件循环播放

C# axWindowsMediaPlayer 多个文件循环播放

2024-06-24 23:14| 来源: 网络整理| 查看: 265

今天在要实现一个用 C# WinForm 上 循环播放 mp4 视频

在网上看了很多博主的文章。学习整理出一个可用方案。记录下来供大家参考

//this.axWindowsMediaPlayer1.URL = @"mp4/A1.mp4"; //this.axWindowsMediaPlayer1.URL = @"C:\Users\Administrator\Desktop\LawSever\bin\Debug\mp4\A1.mp4"; string strWavPath1 = @"mp4/A1.mp4"; string strWavPath2 = @"mp4/A2.mp4"; //创建播放列表 列表名称可为空 //this.axWindowsMediaPlayer1.currentPlaylist = this.axWindowsMediaPlayer1.newPlaylist(" ", ""); this.axWindowsMediaPlayer1.currentPlaylist = this.axWindowsMediaPlayer1.newPlaylist("myPlayList", ""); //播放列表加入要播放的文件 this.axWindowsMediaPlayer1.currentPlaylist.appendItem(this.axWindowsMediaPlayer1.newMedia(strWavPath1)); this.axWindowsMediaPlayer1.currentPlaylist.appendItem(this.axWindowsMediaPlayer1.newMedia(strWavPath2)); this.axWindowsMediaPlayer1.settings.volume = 1;//指定音量 this.axWindowsMediaPlayer1.enableContextMenu = true;//启用/禁用右键菜单 this.axWindowsMediaPlayer1.uiMode = "Full";//播放器界面模式,可为Full, Mini, None, Invisible this.axWindowsMediaPlayer1.settings.setMode("Loop", true);//循环播放 this.axWindowsMediaPlayer1.Ctlcontrols.play();//开始播放

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3